package com.moli.controller;

import com.moli.annotation.SystemLog;
import com.moli.domain.ResponseResult;
import com.moli.domain.entity.User;
import com.moli.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: zzb
 * @Date: 2023/06/08/8:30
 * @Description:
 */

@RestController
@RequestMapping("/user")
public class UserController {

	@Autowired
	private UserService userService;

	@GetMapping("/userInfo")
	public ResponseResult userInfo() {
		return userService.userInfo();
	}

	@PutMapping("/userInfo")
	@SystemLog(businessName = "更新用户信息")
	public ResponseResult updateUserInfo(@RequestBody User user) {
		return userService.updateUserInfo(user);
	}

	@PostMapping("/register")
	public ResponseResult register(@RequestBody User user) {
		return userService.register(user);
	}
}


